<?php
namespace Modules\BlogAdmin\Http\Controllers;
use Illuminate\Http\Request;
use Modules\BlogAdmin\Models\BlogConfig as BlogConfigModel;
use Modules\Admin\Models\Image as ImageModel;
use Modules\Admin\Http\Controllers\CommonController;
class BlogConfigController extends CommonController
{
	
	/**
	 * @name  配置页面
	 */
    public function index()
    {
		$info = BlogConfigModel::with('image_weixin','image_gz','image_q')->find(1)->toArray();
		return view('blogadmin::blog_config.index',compact('info'));
    }
	/**
	 * @name  编辑数据处理
	 */
    public function update(Request $request,$id)
    {
		$data = $request->all();
		$data = (new ImageModel())->blog_edit_image($id,$data);
		if(!is_array($data)){
			return $data;
		};
		return (new BlogConfigModel())->common_update($data,$id,route('blog_admin.config.index')); 
    }
	
	
	
}
